package com.wang.store.controller;

import com.wang.store.entity.Address;
import com.wang.store.entity.District;
import com.wang.store.service.IAddressService;
import com.wang.store.service.IDistrictService;
import com.wang.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RequestMapping("district")
@RestController
public class DistrictController extends BaseController{
    @Autowired
    private IDistrictService iDistrictService;

    @RequestMapping({"/",""})
    public JsonResult<List<District>>  getByParent (String parent){
        List<District> data = iDistrictService.getByParent(parent);

        return new JsonResult<>(OK,data);


    }


}
